package com.xinxin.websocket.utils;

import com.xinxin.websocket.response.Response;

/**
 * @author ：史鑫鑫
 * @date ：Created in 2019/4/28 14:22
 */
public class ResponseUtils {
    private ResponseUtils() {
    }

    public static Response success(String msg, Object data) {
        return new Response(200, msg, data);
    }

    public static Response success(String msg) {
        return success(msg, null);
    }

    public static Response success() {
        return success("成功");
    }

    public static Response error(Integer code, String msg) {
        return new Response(code, msg, null);
    }
}
